package clids.ex2.filters;

import clids.ex2.filters.exceptions.BadFilterNameException;

public class FilterFactory {

	public static AbstractFilter GetFilter(String nameOfFilter,String params) throws BadFilterNameException{
		switch (nameOfFilter){
		case "before":
			return new BeforeFilter(params);
		case "after":
			return new AfterFilter(params);
		case "greater_than":
			return new GreaterThanFilter(params);
		case "between":
			return new BetweenFilter(params);
		case "smaller_than":
			return new SmallerThanFilter(params);
		case "file":
			return new FileFilter(params);
		case "prefix":
			return new PrefixFilter(params);
		case "suffix":
			return new SuffixFilter(params);
		case "writable":
			return new WriteableFilter(params);
		case "executable":
			return new ExecutableFilter(params);
		case "hidden":
			return new HiddenFilter(params);
		case "default":
			return new DefaultFilter(params);
		}
		// TODO Auto-generated catch block
		throw new BadFilterNameException();
	}
}
